import request from '@/utils/request'

// 查询首页水数据列表
export function listHomepage(query) {
    return request({
        url: '/water/homepage/list',
        method: 'get',
        params: query
    })
}

// 查询首页水数据详细
export function getHomepage(id) {
    return request({
        url: '/water/homepage/' + id,
        method: 'get'
    })
}

// 新增首页水数据
export function addHomepage(data) {
    return request({
        url: '/water/homepage',
        method: 'post',
        data: data
    })
}

// 修改首页水数据
export function updateHomepage(data) {
    return request({
        url: '/water/homepage',
        method: 'put',
        data: data
    })
}

// 删除首页水数据
export function delHomepage(id) {
    return request({
        url: '/water/homepage/' + id,
        method: 'delete'
    })
}

// 计算用水趋势并保存
export function calculateHomepage() {
    return request({
        url: '/water/homepage/calculateHomepage',
        method: 'post'
    })
}
